<template>
	<view class="my-container">
		<!-- 用户未登录时，显示登录组件 -->
		<my-login v-if="!token"></my-login>

		<!-- 用户登录后，显示用户信息组件 -->
		<my-userinfo v-else></my-userinfo>
	</view>
</template>

<script>
	import badgeMix from "@/mixins/tabbar-badge.js";
	import { mapState } from "vuex";
	import myLogin from '@/components/my-login/my-login.vue';
	import myUserInfo from '@/components/my-userinfo/my-userinfo.vue';
	export default {
		data() {
			return {};
		},
		mixins: [badgeMix],
		computed: {
			...mapState('m_user', ['token'])
		},
		components: {
			myLogin,
			myUserInfo
		}
	}
</script>

<style lang="scss">
page,
.my-container {
  height: 100%;
}
</style>
